//
//  TransactionTableViewCell.m
//  CYWFrame
//
//  Created by 杨壮 on 2017/9/26.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "TransactionTableViewCell.h"
#import <Masonry.h>
#define W [UIScreen mainScreen].bounds.size.width / 375
#define H ([UIScreen mainScreen].bounds.size.height-64-49) / (667-64-49)

@implementation TransactionTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self CreatUI];
    }
    
    return self;
}

- (void)CreatUI
{
    _Label = [[UILabel alloc]init];
    _Label.textColor = RGB(8, 191, 178);
    _Label.font = kUHSystemFontWithSize(15);
    _Label.numberOfLines = 0;
    //    _Label.text = @"+100元";
    _Label.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_Label];
    [_Label mas_makeConstraints:^(MASConstraintMaker *make) {
        //        make.centerY.mas_equalTo(_TextLabel);
        make.centerY.mas_equalTo(self.contentView.mas_centerY);
        make.right.mas_offset(-15*W);
        make.height.mas_offset(15*H);
//        make.width.mas_offset(SW(5));
    }];
    
    _TextLabel = [[UILabel alloc]init];
    _TextLabel.textColor = RGB(51, 51, 51);
    _TextLabel.font = kUHSystemFontWithSize(13);
//    _TextLabel.text  = @"支付宝充值";
    _TextLabel.numberOfLines = 0;
    [self.contentView addSubview:_TextLabel];
    [_TextLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(16*H);
        make.left.mas_offset(13*W);
//        make.right.mas_offset(-13*W);
        make.right.mas_equalTo(_Label.mas_left).offset(0);
//        make.width.mas_offset(SW(5)*4-13*W);
    }];
    
    _timeLabel = [[UILabel alloc]init];
    _timeLabel.textColor = RGB(153, 153, 153);
    _timeLabel.font = kUHSystemFontWithSize(13);
    _timeLabel.numberOfLines = 0;
//    _timeLabel.text = @"2017-09-15 22:12:50";
    [self.contentView addSubview:_timeLabel];
    [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_TextLabel.mas_bottom).mas_offset(16*H);
        make.left.mas_offset(13*W);
        make.height.mas_offset(13*H);
    }];
    
    _priceLabel = [[UILabel alloc]init];
    _priceLabel.textColor = RGB(51, 51, 51);
    _priceLabel.font = kUHSystemFontWithSize(13);
//    _priceLabel.text = @"余额充值";
    _priceLabel.numberOfLines = 0;
    [self.contentView addSubview:_priceLabel];
    [_priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_TextLabel.mas_bottom).mas_offset(16*H);
        make.right.mas_offset(-13*W);
        make.height.mas_offset(13*H);
        make.bottom.mas_offset(-15*H);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
